import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "layout",
    component: () =>
      import(/* webpackChunkName: "layout" */ "@/views/layout/indexView.vue"),
    children: [
      {
        path: "/",
        name: "home",
        component: () =>
          import(
            /* webpackChunkName: "home" */ "@/views/home/indexView.vue"
          ),
      },
      {
        path: "/list",
        name: "list",
        component: () =>
          import(
            /* webpackChunkName: "list" */ "@/views/list/indexView.vue"
          ),
      },
      {
        path: "/list/add",
        name: "listAdd",
        component: () =>
          import(
            /* webpackChunkName: "listAdd" */ "@/views/listAdd/indexView.vue"
          ),
      },
      {
        path: "/set",
        name: "set",
        component: () =>
          import(
            /* webpackChunkName: "set" */ "@/views/set/indexView.vue"
          ),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
